/*
 * StatusPanel.java
 *
 * Created on 18 de Dezembro de 2004, 18:14
 */

package ceirinhashls.gui;
import java.awt.*;
/**
 *
 * @author  botelhodaniel
 */
public class StatusPanel extends javax.swing.JPanel {
    private boolean isConnected;
    
    /** Creates new form StatusPanel */
    public StatusPanel(boolean isConnected) {
        this.isConnected = isConnected;
        initComponents();
    }
    public void setConnected(boolean value){
        isConnected = value;
    }
    public boolean isConnected(){
        return isConnected;
    }

    public void paint(Graphics g){
        g.setColor(new Color(204,204,204));
        g.fillRect(0, 0, 12, 12);
        if(isConnected())
            g.setColor(Color.GREEN);
        else
            g.setColor(Color.RED);
        g.fillOval(1,1, 10,10);
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents

        setLayout(new java.awt.BorderLayout());

        setBackground(new java.awt.Color(153, 153, 153));
        setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        setPreferredSize(new java.awt.Dimension(12, 12));
    }//GEN-END:initComponents
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
    
}
